package com.atguigu.tingshu.account.service;

import com.atguigu.tingshu.common.result.Result;
import com.atguigu.tingshu.model.account.UserAccount;
import com.atguigu.tingshu.model.account.UserAccountDetail;
import com.atguigu.tingshu.vo.account.AccountLockResultVo;
import com.atguigu.tingshu.vo.account.AccountLockVo;
import com.baomidou.mybatisplus.extension.service.IService;

import java.math.BigDecimal;

public interface UserAccountService extends IService<UserAccount> {


    /**
     * 获取用户账户的可用余额
     *
     * @param userId
     * @return
     */
    BigDecimal getAvailableAmount(Long userId);

    /**
     * 检查并且锁定账户余额
     *
     * @param accountLockVo
     * @return
     */
    Result<AccountLockResultVo> checkAmountAndLockAmount(AccountLockVo accountLockVo);

    /**
     * 记录用户账户流水
     */
    public void log(Long userId, String content, BigDecimal amount, String orderNo, String tradeType);

}
